package com.financing.wap.dto;
import java.util.Date;
import java.math.BigDecimal;

import com.financing.wap.dto.BaseDTO;
import com.financing.wap.util.DateUtil;
/**
 * 会员开通记录
 * @author huqiyun
 *
 */
public class DstMemberSendLogDTO extends BaseDTO  {

	 private String userOpenid;//用户openid
	 private String userParentOpenid;//用户邀请人openid
	 private Integer memberBuyDate;//用户购买时长
	 private BigDecimal memberBuyMoney;//用户购买金额
	 private String memberSendType;//用户赠送类型1会员邀请赠送，2充值购买
	 private Date memberStartDate;//用户会员开始时间
	 private Date memberEndDate;//用户会员结束时间
	 private String memberBizId;//用户业务id如：微信支付表id
	 private String memberBizData;//用户业务数据
	 private BigDecimal memberCommission;//给邀请人佣金

	 private String userParentName;//邀请人姓名
	 private String memberSendTypeStr;//类型
	 private String type;
     //订单编号
	 private String sendOrderCode;
	
	 //会员开始时间
	 private String memberStartDateFormat;
	 //会员结束时间
	 private String memberEndDateFormat;
	//用户购买时长格式化
	 private String memberBuyDateFormat;
	
	 public void setUserOpenid(String userOpenid) {
        this.userOpenid = userOpenid == null ? null : userOpenid.trim();
     }
	 public String getUserOpenid(){
         return userOpenid;
     }
	 public void setUserParentOpenid(String userParentOpenid) {
        this.userParentOpenid = userParentOpenid == null ? null : userParentOpenid.trim();
     }
	 public String getUserParentOpenid(){
         return userParentOpenid;
     }
   	 public void setMemberBuyDate(Integer memberBuyDate) {
        this.memberBuyDate = memberBuyDate == null ? null : memberBuyDate;
     }
	 public Integer getMemberBuyDate(){
         return memberBuyDate;
     }
	 public BigDecimal getMemberBuyMoney() {
		return memberBuyMoney;
	}
	public void setMemberBuyMoney(BigDecimal memberBuyMoney) {
		this.memberBuyMoney = memberBuyMoney;
	}
	public void setMemberBizId(String memberBizId) {
		this.memberBizId = memberBizId;
	}
	public void setMemberSendType(String memberSendType) {
        this.memberSendType = memberSendType == null ? null : memberSendType.trim();
     }
	 public String getMemberSendType(){
         return memberSendType;
     }
   	 public void setMemberStartDate(Date memberStartDate) {
        this.memberStartDate = memberStartDate == null ? null : memberStartDate;
     }
	 public Date getMemberStartDate(){
         return memberStartDate;
     }
   	 public void setMemberEndDate(Date memberEndDate) {
        this.memberEndDate = memberEndDate == null ? null : memberEndDate;
     }
	 public Date getMemberEndDate(){
         return memberEndDate;
     }
	 public void setMemberBizData(String memberBizData) {
        this.memberBizData = memberBizData == null ? null : memberBizData.trim();
     }
	 public String getMemberBizData(){
         return memberBizData;
     }
	public BigDecimal getMemberCommission() {
		return memberCommission;
	}
	public void setMemberCommission(BigDecimal memberCommission) {
		this.memberCommission = memberCommission;
	}
	public String getMemberBizId() {
		return memberBizId;
	}

	public String getUserParentName() {
		return userParentName;
	}

	public void setUserParentName(String userParentName) {
		this.userParentName = userParentName;
	}

	public String getMemberSendTypeStr() {
		return memberSendTypeStr;
	}

	public void setMemberSendTypeStr(String memberSendTypeStr) {
		this.memberSendTypeStr = memberSendTypeStr;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	public String getSendOrderCode() {
		return sendOrderCode;
	}
	public void setSendOrderCode(String sendOrderCode) {
		this.sendOrderCode = sendOrderCode;
	}
	
	public String getMemberStartDateFormat() {
		if(this.memberStartDate==null)return "";
		return DateUtil.formatDate(this.memberStartDate, "yyyy-MM-dd HH:mm");
	}
	public void setMemberStartDateFormat(String memberStartDateFormat) {
		this.memberStartDateFormat = memberStartDateFormat;
	}
	public String getMemberEndDateFormat() {
		if(this.memberEndDate==null)return "";
		return DateUtil.formatDate(this.memberEndDate, "yyyy-MM-dd HH:mm");
	}
	public void setMemberEndDateFormat(String memberEndDateFormat) {
		this.memberEndDateFormat = memberEndDateFormat;
	}
	public String getMemberBuyDateFormat() {
		if(this.memberBuyDate==null)return "";
		if(this.memberBuyDate==7){
			return "7天";
		}else if(this.memberBuyDate==31){
			return "1个月";
		}else if(this.memberBuyDate==93){
			return "3个月";
		}else if(this.memberBuyDate==186){
			return "半年";
		}else if(this.memberBuyDate==372){
			return "1年";
		}
		return memberBuyDateFormat;
	}
	public void setMemberBuyDateFormat(String memberBuyDateFormat) {
		this.memberBuyDateFormat = memberBuyDateFormat;
	}
}